/******************************************************************
 * 作者：sipeiliu
 * 邮箱：sipeiliu@163.com
 * 描述：巡航模块，设定行走路线
 * 日期：2023.4.20
 ******************************************************************/
#include "/opt/sighter/inc/cruise.h"
#include "/opt/sighter/inc/motor.h"

#include <unistd.h>
#include <stdio.h>

/*巡航模式*/
void *thread_cruise(void *arg)
{   
    int ret;
    while (1)
    {
        motor_run(FORWARD);
        ret = usleep(1000); //1000us
        if(ret == -1)
        {
            perror("usleep error");
        }
        motor_run(STOP);
        ret = usleep(1000); //1000us
        if(ret == -1)
        {
            perror("usleep error");
        }
    }
}